import re
'''
匹配手机和邮箱
'''

# print('+')

# p='1233445563'
# matchs=re.match(r'^1[1-9]{10}$',p)
# print(matchs)

# p1='TRC2923_@.cndf'

# m=re.match(r'(\w+)@([1-9a-zA-Z]+?).(cn|com)$',p1)
# if m is not None:
#     print(m.group())
#     print(m.groups())
# else:
#     print('匹配不上')

import os
# encoding utf-8
#window 读取文件可以用\，但是在字符串中\是被当作转义字符来使用，经过转义之后可能就找不到路径的资源了，例如\t会转义为tab键

if __name__ == '__main__':
    sqls='''case when actual_forensics_date <= '${hivevar:data_date}' then sign_unsold_num else 0 end as PILVL0027 
       case
        when actual_forensics_date is not null
        and actual_forensics_date <= '${hivevar:partitiondate}'
        and (actual_opendate is null or actual_opendate > '${hivevar:data_date}')'''
    matchs=re.findall(r'(\$\{.*\})',sqls)
    if matchs is not None:
        print(set(matchs))
    paths=r'C:\Users\me\Downloads\jobs\scripts\项目\销售管理\明细层_dwd'
    p=paths.replace(r'\\','\\\\')
    print(os.path.sep)
    print(p)